home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / minloc.z / minloc
Encoding:
Text File  |  2002-10-03  |  6.1 KB  |  139 lines

  1. MINLOC(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      MMIINNLLOOCC - Returns the location of a minimum value in an array
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMIINNLLOOCC (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMIINNLLOOCC intrinsic function can be used for array location.  It
  20.      returns the location of the first element of _a_r_r_a_y that has the
  21.      minimum value of the elements identified by _m_a_s_k.  It accepts the
  22.      following arguments:
  23.  
  24.      _a_r_r_a_y     Must be of type integer or real.  It must not be scalar.
  25.  
  26.      _d_i_m       Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
  27.                where _n is the rank of _a_r_r_a_y.  The corresponding actual
  28.                argument must not be an optional dummy argument.
  29.  
  30.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  31.  
  32.      MMIINNLLOOCC is a transformational function.  The name of this intrinsic
  33.      cannot be passed as an argument.
  34.  
  35. NNOOTTEESS
  36.      On UNICOS systems, both execution speed and the number of bits used in
  37.      mathematical operations are affected when compiling with
  38.      ff9900 --OO ffaassttiinntt, which is the default setting.  For more information,
  39.      see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  40.  
  41. RREETTUURRNN VVAALLUUEESS
  42.      The result is an integer array of type default integer, of rank one,
  43.      with size equal to the rank of _a_r_r_a_y.
  44.  
  45.      The result of MMIINNLLOOCC((_a_r_r_a_y)) is a rank-one array whose element values
  46.      are the values of the subscripts of an element of _a_r_r_a_y whose value
  47.      equals the minimum value of all of the elements of _a_r_r_a_y.  The _ith
  48.      subscript returned lies in the range 1 to _e ,
  49.                                                 _i
  50.      where _e
  51.             _i
  52.      is the extent of the _ith dimension of _a_r_r_a_y.  If more than one element
  53.      has the minimum value, the element whose subscripts are returned is
  54.      the first such element, taken in array element order.  If _a_r_r_a_y has
  55.      size zero, the value of the result is undefined.
  56.  
  57.      The result of MMIINNLLOOCC((_a_r_r_a_y,,MMAASSKK==_m_a_s_k)) is a rank-one array whose
  58.      element values are the values of the subscripts of an element of
  59.      _a_r_r_a_y, corresponding to a true element of _m_a_s_k whose value equals the
  60.      minimum value of all such elements of _a_r_r_a_y.  The _ith subscript
  61.      returned lies in the range 1 to _e ,
  62.                                       _i
  63.      where _e
  64.             _i
  65.      is the extent of the _ith dimension of _a_r_r_a_y.  If more than one such
  66.      element has the minimum value, the element whose subscripts are
  67.      returned is the first such element taken in array element order.  If
  68.      there are no such elements (that is, if _a_r_r_a_y has size zero or every
  69.      element of _m_a_s_k has the value false), the value of the result is
  70.      undefined.
  71.  
  72.      If _a_r_r_a_y has rank one, the result of
  73.      MMIINNLLOOCC((_a_r_r_a_y,, DDIIMM==_d_i_m [,, MMAASSKK==_m_a_s_k])) is a scalar with a value that is
  74.      the same as that of the first element of MMIINNLLOOCC((_a_r_r_a_y [,, MMAASSKK==_m_a_s_k])).
  75.      Otherwise, the value of element (_s , _s , ..., _s     , _s     , ..., _s )
  76.                                        1   2        _d_i_m-1   _d_i_m+1        _n
  77.      of the result is equal to
  78.      MMIINNLLOOCC((_a_r_r_a_y(_s , _s , ..., _s     , : , _s     , ..., _s )),, DDIIMM==11
  79.                    1   2        _d_i_m-1       _d_i_m+1        _n
  80.      [,, MMAASSKK==_m_a_s_k(_s , _s , ..., _s     , : , _s     , ..., _s )])).
  81.                    1   2        _d_i_m-1       _d_i_m+1        _n
  82.      An element of the result is undefined if the value cannot be
  83.      represented as an integer.
  84.  
  85. EEXXAAMMPPLLEESS
  86.      Example 1:  The value of MMIINNLLOOCC(( ((// 44,, 33,, 66,, 33 //)) )) is [2].  If array
  87.      B is declared IINNTTEEGGEERR,, DDIIMMEENNSSIIOONN((44::77)) :::: BB == ((//88,, 66,, 33,, 11 //)), the
  88.      value of MMIINNLLOOCC((BB)) is [4].
  89.  
  90.      Example 2:  Assume that AA is the following array:
  91.  
  92.         | 0 -5  8 -3 |
  93.  
  94.         | 3  4 -1  2 |
  95.  
  96.         | 1  5  6 -4 |
  97.  
  98.      The following are true:
  99.  
  100.           MMIINNLLOOCC((AA)) is [1, 2]
  101.  
  102.           MMIINNLLOOCC((AA,, MMAASSKK==AA ..GGTT.. --44)) is [1, 4]
  103.  
  104.      Using array section references, the following are true:
  105.  
  106.           MMIINNLLOOCC((AA((22::33,,22::44)))) is [ 2, 3 ]
  107.  
  108.           MMIINNLLOOCC((AA((22::33,,22::44)),,MMAASSKK==AA((22::33,,22::44))..GGTT..--44)) is [ 1, 2 ]
  109.  
  110.      Example 3:  Assume that BB is the following array:
  111.  
  112.           [ 100, 2, 5, 7, 1, 90, 0, 20, -1, 80 ]
  113.  
  114.      The following are true:
  115.  
  116.           MMIINNLLOOCC((BB((1100::11::--11)))) is 2
  117.  
  118.           MMIINNLLOOCC((BB((1100::11::--22)))) is 5
  119.  
  120.      Example 4:  The value of MMIINNLLOOCC((((//55,,--99,,33//)),,DDIIMM==11)) is 22.
  121.  
  122.      Example 5:  Assume that CC is the following array:
  123.  
  124.         | 1 3 -9 |
  125.  
  126.         | 2 2  6 |
  127.  
  128.      The following are true of this array:
  129.  
  130.           MMIINNLLOOCC((CC,,DDIIMM==11)) is [ 1, 2, 1 ]
  131.  
  132.           MMIINNLLOOCC((CC,,DDIIMM==22)) is [ 3, 1 ]
  133.  
  134.           MMIINNLLOOCC((CC)) is [ 3, 1 ]
  135.  
  136. SSEEEE AALLSSOO
  137.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  138.      man page.
  139.